package com.tank.decoration;

import com.tank.entrity.GameObject;
import java.awt.*;

public class RectDecorator extends GameDecorator {

    public RectDecorator(GameObject gameObject) {
        super(gameObject);
    }

    @Override
    public void paint(Graphics graphics) {
        super.paint(graphics);
        Color color = graphics.getColor();
        graphics.setColor(Color.MAGENTA);
        graphics.drawRect((int) super.getGameObject().x, (int) super.getGameObject().y, getWidth(), getHeight());
        graphics.setColor(color);
    }

    @Override
    public int getWidth() {
        return super.getGameObject().getWidth();
    }

    @Override
    public int getHeight() {
        return super.getGameObject().getHeight();
    }
}
